This function can be used to set a rectangular region of a given grid to a specified value (which can be either a real or a string) as illustrated by the image shown below:
ds_grid_set_region(index, x1, y1, x2, y2, val);
参数 | 描述 |
---|---|
index | 栅格的索引 |
x1 | 栅格内区域左端x位置。 |
y1 | 栅格内区域顶端的y位置。 |
x2 | 栅格内区域右端x位置。 |
y2 | 栅格内区域底端的y位置。 |
val | The value to set the region cells to. |
N/A(无返回值)
ds_grid_set_region(grid, 5, 5, 10, 10, 99)
This would set all cells within the region of the grid indexed in the variable "grid" from (5,5) to (10,10) to 99.